function [frameSet, timeAxis] = enframe(data, fs, timeperFrame, overlapRate, winF)
Ts = 1/fs;
dataLength = length(data);
frameLength = floor(fs/1000*timeperFrame);    % 20ms per frame
frameOverlap = floor(frameLength*overlapRate);
frameShift = frameLength- frameOverlap;
frameNum = floor(dataLength/frameShift);
tempLength = frameNum* frameShift;
if dataLength > tempLength
    x = [data; zeros(frameLength- (dataLength- tempLength), 1)];
    frameNum = frameNum+ 1;
    dataLength = length(x);
else
    x = data;
    frameNum = frameNum- 1;
end
frameSet = zeros(frameLength, frameNum);
winfunc = str2func(winF);
winfunc = winfunc(frameLength);
%frameIndex = (1: frameLength)+ frameShift*(0: frameNum-1);
for k = 1: frameNum
    frameSet(:, k) = x(1+frameShift*(k-1): frameLength+ frameShift*(k-1)).* winfunc;
end
timeAxis = frameLength* Ts+ (0: frameNum-1)*frameShift*Ts;
end